/**
 * Copyright (C) 2011 The Android Open Source Project
 * Emial : guoyil199@163.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com;

public class Test {

	static String  data="1&&4e797fe03b6352d26e6a594c1d6f1d61";
	static String noChar="";
	public static void main(String[] args) {
		 //String[] strDa=data.split("\\&",-1);
		 //System.out.println(strDa[0]);
         //String[] plateNos =strDa[1].split("\\~",-1);
         //System.out.println("tictka lenght: "+plateNos.length+ " toString:" +plateNos.toString());
         //for (int i = 0; i < plateNos.length; i++) {
           //  String ticketSub=plateNos[i];
//             if(ticketSub==null || "".equals(ticketSub)){
//                 continue;
//             }
             //String[] palteNoStrs = ticketSub.split("\\|",-1);
             //System.out.println("sub "+palteNoStrs.toString());
         //}

         //System.out.println(noChar.split("\\|",-1));

//		for(int i=0;i<10;i++){
//		  ramodInt(3);
//		}

		String pattern="activity://test1/test2?p1=1";
		String params=null;
		String action=pattern;
        int idx=-1;
        if((idx=action.indexOf('?'))!=-1){
            action=action.substring(0,idx);
            params=pattern.substring(idx+1);
            System.out.println("action="+action);
            System.out.println("params="+params);
        }
		
        String[] par=params.split("&",-1);
        for (String p : par) {
            if(p==null || "".equals(p.trim())){
                continue;
            }
            String[]keyValue=p.split("=",-1);
            if(keyValue.length<2)continue;
            System.out.println("key="+keyValue[0]+" value="+keyValue[1]);
        }
        
	}


	public static void test1(){
		String str="12344444444444444444444";

	}


	static int ramodInt(int i){
		//Random rand =new Random(3);
		//int r=rand.nextInt(3)+1;
		int r=(int)(Math.random() *i)+1;
		System.out.println("ramodInt"+r);
		return r;
	}





}
